import React, { Component } from "react";

export default class Son extends Component {
    
    render() {
        return (
            <div>
                <img onClick={this.change} width="500" src={this.props.url} alt="" />
            </div>
        );
    }

    change = () => {
        //调用父级组件中的 change 方法
        this.props.change();
    }
}
